<template>
  <div class="child">
    <h3>Child组件</h3>
    {{sum}}
  </div>
</template>

<script>
import {reactive, ref} from "vue";

export default {
  name: "Child",
  components: {},
  props: [],
  emits: [], // 用于注册VC的自定义事件，可不写，但会报警
  async setup() {
    let sum = ref(0);
    let p = new Promise((resolve, reject) => {
      setTimeout(() => {
        resolve({sum});
      }, 1000);
    });

    return await p;
  },
}
</script>

<style scoped>
.child {
  background-color: skyblue;
  padding: 10px;
}
</style>